import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
/**
 * La clase AxisMotion agrupa los datos que describen el 
 * estado, movimiento y posición de los ejes.
 */
public class AxisMotion extends DataCategory
{
    public AxisMotion()
    {
        for(int i = 0; i < 3; i++)
        {
            aLHLSIcon[i] = NewComp.getLabel();
            aRHLSIcon[i] = NewComp.getLabel();
        }
    }
    public boolean initData(int id,int value)
    {
        if(id<=0x0F)
            switch(id)
            {
                case KbdCmdId.CmdId.HANDWHEEL:
                    switch(value)
                    {
                        case KbdCmdId.CmdValue.HANDWHEEL_FACTOR_1:
                            handwheelF = HandwheelF.HF_1;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_FACTOR_10:
                            handwheelF = HandwheelF.HF_10;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_FACTOR_100:
                            handwheelF = HandwheelF.HF_100;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_X:
                            handwheelA = HandwheelA.HA_X;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_Y:
                            handwheelA = HandwheelA.HA_Y;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_Z:
                            handwheelA = HandwheelA.HA_Z;
                            break;
                        default:
                            return false;
                    }
                    return true;
                case KbdCmdId.CmdId.JOG_FEEDRATE:
                    //NewComp.proofFrame.addText("initData id = "+ id +" "+"value = "+ value +"");
                    jogFeedrate = Long.valueOf(value);
                    return true;
                default:
                    return false;
            }
        else
            switch(id)
            {
                case CUTTING_MODE:
                    cuttingMode = Integer.valueOf(value);
                    return true;
                case DEFAULT_CUTTING_FEEDRATE:
                    dfltCutFeedrate = Long.valueOf(value);
                    return true;
                case CUTTING_FEEDRATE:
                    cutFeedrate = Long.valueOf(value);
                    return true;
                case CUTTING_FEEDRATE_OVERRIDE:
                    cutFeedrateO = Integer.valueOf(value);
                    return true;
                case MAXIMUM_CUTTING_FEEDRATE:
                    maxCutFeedrate = Long.valueOf(value);
                    return true;
                case MAXIMUM_JOG_FEEDRATE:
                    maxJogFeedrate = Long.valueOf(value);
                    return true;
                case JOG_FEEDRATE_OVERRIDE:
                    jogFeedrateO = Integer.valueOf(value);
                    return true;
                case FAST_ZRTR:
                    fastZRTR = Long.valueOf(value);
                    return true;
                case SLOW_ZRTR:
                    slowZRTR = Long.valueOf(value);
                    return true;
                case RAPID_TRAVERSE_RATE:
                    rapidTR = Long.valueOf(value);
                    return true;
                case RAPID_TRAVERSE_RATE_OVERRIDE:
                    rapidTRO = Integer.valueOf(value);
                    return true;
                case MAXIMUM_TRAVERSE_RATE:
                    maxRapidTR = Long.valueOf(value);
                    return true;
                case X_AXIS_MOTION_TRAVEL_RANGE:
                    xAMTR = Integer.valueOf(value);
                    return true;
                case Y_AXIS_MOTION_TRAVEL_RANGE:
                    yAMTR = Integer.valueOf(value);
                    return true;
                case Z_AXIS_MOTION_TRAVEL_RANGE:
                    zAMTR = Integer.valueOf(value);
                    return true;
                case X_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    xARPRD = Integer.valueOf(value);
                    return true;
                case Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    yARPRD = Integer.valueOf(value);
                    return true;
                case Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    zARPRD = Integer.valueOf(value);
                    return true;
                case X_LEFT_AXIS_HARD_LIMIT_SWITCH:
                    xALHLS = Integer.valueOf(value);
                    return true;
                case X_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                    xARHLS = Integer.valueOf(value);
                    return true;
                case Y_LEFT_AXIS_HARD_LIMIT_SWITCH:
                    yALHLS = Integer.valueOf(value);
                    return true;
                case Y_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                    yARHLS = Integer.valueOf(value);
                    return true;
                case Z_LEFT_AXIS_HARD_LIMIT_SWITCH:
                    zALHLS = Integer.valueOf(value);
                    return true;
                case Z_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                    zARHLS = Integer.valueOf(value);
                    return true;
                case X_AXIS_CURRENT_POSITION:
                    xACP = Integer.valueOf(value);
                    return true;
                case Y_AXIS_CURRENT_POSITION:
                    yACP = Integer.valueOf(value);
                    return true;
                case Z_AXIS_CURRENT_POSITION:
                    zACP = Integer.valueOf(value);
                    return true;
                default:
                    return false;
            }
    }
    public boolean initData(int id,long value)
    {
        if(id<=0x0F)
            switch(id)
            {
                /*case KbdCmdId.CmdId.HANDWHEEL:
                    switch(value)
                    {
                        case KbdCmdId.CmdValue.HANDWHEEL_FACTOR_1:
                            handwheelF = HandwheelF.HF_1;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_FACTOR_10:
                            handwheelF = HandwheelF.HF_10;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_FACTOR_100:
                            handwheelF = HandwheelF.HF_100;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_X:
                            handwheelA = HandwheelA.HA_X;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_Y:
                            handwheelA = HandwheelA.HA_Y;
                            break;
                        case KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_Z:
                            handwheelA = HandwheelA.HA_Z;
                            break;
                        default:
                            return false;
                    }
                    return true;*/
                case KbdCmdId.CmdId.JOG_FEEDRATE:
                    //NewComp.proofFrame.addText("initData id = "+ id +" "+"value = "+ value +"");
                    jogFeedrate = Long.valueOf(value);
                    return true;
                default:
                    return false;
            }
        else
            switch(id)
            {
                /*case CUTTING_MODE:
                    cuttingMode = Integer.valueOf(value);
                    return true;*/
                case DEFAULT_CUTTING_FEEDRATE:
                    dfltCutFeedrate = Long.valueOf(value);
                    return true;
                case CUTTING_FEEDRATE:
                    cutFeedrate = Long.valueOf(value);
                    return true;
                /*case CUTTING_FEEDRATE_OVERRIDE:
                    cutFeedrateO = Integer.valueOf(value);
                    return true;*/
                case MAXIMUM_CUTTING_FEEDRATE:
                    maxCutFeedrate = Long.valueOf(value);
                    return true;
                case MAXIMUM_JOG_FEEDRATE:
                    maxJogFeedrate = Long.valueOf(value);
                    return true;
                /*case JOG_FEEDRATE_OVERRIDE:
                    jogFeedrateO = Integer.valueOf(value);
                    return true;*/
                case FAST_ZRTR:
                    fastZRTR = Long.valueOf(value);
                    return true;
                case SLOW_ZRTR:
                    slowZRTR = Long.valueOf(value);
                    return true;
                case RAPID_TRAVERSE_RATE:
                    rapidTR = Long.valueOf(value);
                    return true;
                /*case RAPID_TRAVERSE_RATE_OVERRIDE:
                    rapidTRO = Integer.valueOf(value);
                    return true;*/
                case MAXIMUM_TRAVERSE_RATE:
                    maxRapidTR = Long.valueOf(value);
                    return true;
                /*case X_AXIS_MOTION_TRAVEL_RANGE:
                    xAMTR = Integer.valueOf(value);
                    return true;
                case Y_AXIS_MOTION_TRAVEL_RANGE:
                    yAMTR = Integer.valueOf(value);
                    return true;
                case Z_AXIS_MOTION_TRAVEL_RANGE:
                    zAMTR = Integer.valueOf(value);
                    return true;*/
                /*case X_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    xARPRD = Integer.valueOf(value);
                    return true;
                case Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    yARPRD = Integer.valueOf(value);
                    return true;
                case Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    zARPRD = Integer.valueOf(value);
                    return true;*/
                /*case X_LEFT_AXIS_HARD_LIMIT_SWITCH:
                    xALHLS = Integer.valueOf(value);
                    return true;
                case X_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                    xARHLS = Integer.valueOf(value);
                    return true;
                case Y_LEFT_AXIS_HARD_LIMIT_SWITCH:
                    yALHLS = Integer.valueOf(value);
                    return true;
                case Y_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                    yARHLS = Integer.valueOf(value);
                    return true;
                case Z_LEFT_AXIS_HARD_LIMIT_SWITCH:
                    zALHLS = Integer.valueOf(value);
                    return true;
                case Z_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                    zARHLS = Integer.valueOf(value);
                    return true;*/
                /*case X_AXIS_CURRENT_POSITION:
                    xACP = Integer.valueOf(value);
                    return true;
                case Y_AXIS_CURRENT_POSITION:
                    yACP = Integer.valueOf(value);
                    return true;
                case Z_AXIS_CURRENT_POSITION:
                    zACP = Integer.valueOf(value);
                    return true;*/
                default:
                    return false;
            }
    }
    public Component getView(Id viewID)
    {
        JPanel panel = new JPanel();
        JPanel p_aux1;
        JPanel p_aux2;
        JPanel p_aux3;
        JLabel xLabel;
        JLabel yLabel;
        JLabel zLabel;
        GridBagConstraints constraints = new GridBagConstraints();
        switch(viewID)
        {
            case CUTTING_MODE:
                panel.setLayout(new GridLayout(1,2));
                JPanel p_aux = new JPanel();
                JLabel cuttingModeLabel = NewComp.getLabel("cuttingMode","titleLabelTFrame","blue");
                cuttingModeField = NewComp.getTxtField(cuttingModeOpt[cuttingMode], "textFieldTFrame");
                p_aux.add(cuttingModeField);
                panel.add(cuttingModeLabel);
                panel.add(p_aux);
                return panel;
            case FEEDRATE:
                panel.setLayout(new BoxLayout(panel,BoxLayout.X_AXIS));
                p_aux1 = new JPanel(new GridBagLayout());//new GridLayout(3,1));
                //p_aux2 = new JPanel(new GridBagLayout());
                fField.setValue(Integer.valueOf(
                    (int)toMmOrIn(
                        PathPlanning.getMetricSystem(),
                        getFeedrate()
                    )
                ));
                fBar.setMaximum(getMaximum());
                fBar.setMinimum(getMinimum());
                fBar.setValue(getOverride());
                fBar.setString(""+getOverride()+"%");
                //p_aux1.add(new JPanel());
                p_aux1.add(fField,new GridBagConstraints());
                //p_aux1.add(new JPanel());
                //p_aux2.add(fField,new GridBagConstraints());
                panel.add(fBar);
                panel.add(p_aux1);
                return panel;
            case AXIS_LIMIT_SWITCH:
                panel.setLayout(new GridLayout(6, 2));
                String xys[] = {"x","y","z"};
                String aLHLS[] = {
                    axisHLSOpt[xALHLS],
                    axisHLSOpt[yALHLS],
                    axisHLSOpt[zALHLS]
                };
                String aRHLS[] = {
                    axisHLSOpt[xARHLS],
                    axisHLSOpt[yARHLS],
                    axisHLSOpt[zARHLS]
                };
                JLabel aLHLSLabel;
                JLabel aRHLSLabel;
                for(int i = 0; i < 3; i++)
                {
                    aLHLSLabel = NewComp.getLabel(xys[i]+"ALHLS", "titleLabelTFrame", "blue");
                    aLHLSIcon[i].setIcon(NewComp.getIcon(aLHLS[i]));
                    panel.add(aLHLSLabel);
                    panel.add(aLHLSIcon[i]);
                    aRHLSLabel = NewComp.getLabel(xys[i]+"ARHLS", "titleLabelTFrame", "blue");
                    aRHLSIcon[i].setIcon(NewComp.getIcon(aRHLS[i]));
                    panel.add(aRHLSLabel);
                    panel.add(aRHLSIcon[i]);
                }   
                return panel;
            case AXIS_CURRENT_POSITION:
                panel.setLayout(new GridLayout(3,2));
                p_aux1 = new JPanel(new GridBagLayout());
                p_aux2 = new JPanel(new GridBagLayout());
                p_aux3 = new JPanel(new GridBagLayout());
                xLabel = NewComp.getLabel("x","titleLabelTFrame","blue");
                yLabel = NewComp.getLabel("y","titleLabelTFrame","blue");
                zLabel = NewComp.getLabel("z","titleLabelTFrame","blue");
                xACPField = NewComp.getFTF(
                    PathPlanning.getMetricSystem().equals("international"),
                    "textFieldNumTFrame"
                );
                yACPField = NewComp.getFTF(
                    PathPlanning.getMetricSystem().equals("international"),
                    "textFieldNumTFrame"
                );
                zACPField = NewComp.getFTF(
                    PathPlanning.getMetricSystem().equals("international"),
                    "textFieldNumTFrame"
                );
                xACPField.setValue(xACP);
                yACPField.setValue(yACP);
                zACPField.setValue(zACP);
                constraints.anchor = GridBagConstraints.CENTER;
                p_aux1.add(xACPField,constraints);
                p_aux2.add(yACPField,constraints);
                p_aux3.add(zACPField,constraints);
                panel.add(xLabel);
                panel.add(p_aux1);
                panel.add(yLabel);
                panel.add(p_aux2);
                panel.add(zLabel);
                panel.add(p_aux3);
                return panel;
            case AXIS_MOTION_TRAVEL_RANGE:
                panel.setLayout(new GridLayout(3,2));
                p_aux1 = new JPanel(new GridBagLayout());
                p_aux2 = new JPanel(new GridBagLayout());
                p_aux3 = new JPanel(new GridBagLayout());
                xLabel = NewComp.getLabel("x","titleLabelTFrame","blue");
                yLabel = NewComp.getLabel("y","titleLabelTFrame","blue");
                zLabel = NewComp.getLabel("z","titleLabelTFrame","blue");
                JFormattedTextField xAMTRField = NewComp.getFTF(
                    PathPlanning.getMetricSystem().equals("international"),
                    "textFieldNumTFrame"
                );
                JFormattedTextField yAMTRField = NewComp.getFTF(
                    PathPlanning.getMetricSystem().equals("international"),
                    "textFieldNumTFrame"
                );
                JFormattedTextField zAMTRField = NewComp.getFTF(
                    PathPlanning.getMetricSystem().equals("international"),
                    "textFieldNumTFrame"
                );
                xAMTRField.setValue(Integer.valueOf(xAMTR));
                yAMTRField.setValue(Integer.valueOf(yAMTR));
                zAMTRField.setValue(Integer.valueOf(zAMTR));
                constraints.anchor = GridBagConstraints.CENTER;
                p_aux1.add(xAMTRField,constraints);
                p_aux2.add(yAMTRField,constraints);
                p_aux3.add(zAMTRField,constraints);
                panel.add(xLabel);
                panel.add(p_aux1);
                panel.add(yLabel);
                panel.add(p_aux2);
                panel.add(zLabel);
                panel.add(p_aux3);
                return panel;
            case AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                panel.setLayout(new GridLayout(3, 2));
                xLabel = NewComp.getLabel("x", "titleLabelTFrame", "blue");
                yLabel = NewComp.getLabel("y", "titleLabelTFrame", "blue");
                zLabel = NewComp.getLabel("z", "titleLabelTFrame", "blue");
                JLabel xARPRDIcon = NewComp.getLabel();
                JLabel yARPRDIcon = NewComp.getLabel();
                JLabel zARPRDIcon = NewComp.getLabel();
                xARPRDIcon.setIcon(
                    NewComp.getIcon(arprdOpt[xARPRD]));
                yARPRDIcon.setIcon(
                    NewComp.getIcon(arprdOpt[yARPRD]));
                zARPRDIcon.setIcon(
                    NewComp.getIcon(arprdOpt[zARPRD]));
                panel.add(xLabel);
                panel.add(xARPRDIcon);
                panel.add(yLabel);
                panel.add(yARPRDIcon);
                panel.add(zLabel);
                panel.add(zARPRDIcon);
                return panel;
            default:
                return null;
        }
    }
    public Component getEditor(Id editorID)
    {
        JPanel panel;
        JPanel panel_aux;
        JPanel panel_aux1;
        JPanel panel_aux2;
        JPanel panel_aux3;
        JPanel panel_aux4;
        ButtonGroup group;
        switch(editorID)
        {
            case ZERO_RETURN:
                panel = NewComp.getPanel(
                    "zeroReturnMode",
                    "titleBorderBFrame",
                    new GridLayout(1,3,16,16));
                JButton xButton = NewComp.getButton(
                    "xZeroReturn",
                    "titleButton",
                    "blue",
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, 
                                KbdCmdId.CmdValue.AXIS_X_POSITIVE_SELECT);
                        }
                    });
                JButton yButton = NewComp.getButton(
                    "yZeroReturn",
                    "titleButton",
                    "blue",
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, 
                                KbdCmdId.CmdValue.AXIS_Y_POSITIVE_SELECT);
                        }
                    });
                JButton zButton = NewComp.getButton(
                    "zZeroReturn",
                    "titleButton",
                    "blue",
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, 
                                KbdCmdId.CmdValue.AXIS_Z_POSITIVE_SELECT);
                        }
                    });
                panel.add(xButton);
                panel.add(yButton);
                panel.add(zButton);
                return panel;
            case CUTTING_FEEDRATE_OVERRIDE:
                panel = NewComp.getPanel(new BorderLayout());
                JLabel cutLabel = NewComp.getLabel("cuttingFeedrateO","titleLabelBFrame","black");
                JSlider cuttingFOSlider = NewComp.getSlider(0,120,cutFeedrateO.intValue());
                cuttingFOSlider.addChangeListener( new
                    ChangeListener()
                    {
                        public void stateChanged(ChangeEvent event)
                        {
                            JSlider aux = (JSlider) event.getSource();
                            cutFeedrateO = Integer.valueOf(aux.getValue());
                            InfoManager.addCommand(KbdCmdId.CmdId.FEEDRATE_OVERRIDE, aux.getValue());
                        }
                    }
                );
                panel_aux1 = new JPanel();
                panel_aux2 = new JPanel();
                panel_aux1.add(cutLabel);
                panel_aux2.add(cuttingFOSlider);
                panel.add(panel_aux1, BorderLayout.NORTH);
                panel.add(panel_aux2, BorderLayout.CENTER);
                return panel;
            case RAPID_TRAVERSE_RATE_OVERRIDE:
                panel = NewComp.getPanel(new BorderLayout());
                JLabel rapidLabel = NewComp.getLabel("rapidTraverseRateO","titleLabelBFrame","black");
                JSlider rapidTROSlider = NewComp.getSlider(0,120,rapidTRO.intValue());
                rapidTROSlider.addChangeListener( new
                    ChangeListener()
                    {
                        public void stateChanged(ChangeEvent event)
                        {
                            JSlider aux = (JSlider) event.getSource();
                            InfoManager.addCommand(KbdCmdId.CmdId.RAPID_FEEDRATE_OVERRIDE, aux.getValue());
                        }
                    }
                );
                panel_aux1 = new JPanel();
                panel_aux2 = new JPanel();
                panel_aux1.add(rapidLabel);
                panel_aux2.add(rapidTROSlider);
                panel.add(panel_aux1, BorderLayout.NORTH);
                panel.add(panel_aux2, BorderLayout.CENTER);
                return panel;
            case JOG_FEEDRATE:
                panel = NewComp.getPanel(new BorderLayout());
                JLabel jogFLabel = NewComp.getLabel("jogFeedrate","titleLabelBFrame","black");
                PathPlanning pathP = new PathPlanning();
                int max = (int)toMmOrIn(PathPlanning.getMetricSystem(),maxJogFeedrate.intValue());
                int value =(int)toMmOrIn(PathPlanning.getMetricSystem(),jogFeedrate.intValue());
                JSlider jogFSlider = NewComp.getSlider(
                    0,
                    max,
                    value < max ? value : max);
                if(max == 0)
                    jogFSlider.setEnabled(false);
                jogFSlider.addChangeListener( new
                    ChangeListener()
                    {
                        public void stateChanged(ChangeEvent event)
                        {
                            JSlider aux = (JSlider) event.getSource();
                            jogFeedrate = toNm(PathPlanning.getMetricSystem(),(float)aux.getValue());
                            InfoManager.addCommand(
                                KbdCmdId.CmdId.JOG_FEEDRATE, 
                                (long)toNm(PathPlanning.getMetricSystem(),(float)aux.getValue())
                            );
                        }
                    }
                );
                panel_aux1 = new JPanel();
                panel_aux2 = new JPanel();
                panel_aux1.add(jogFLabel);
                panel_aux2.add(jogFSlider);
                panel.add(panel_aux1,BorderLayout.NORTH);
                panel.add(panel_aux2,BorderLayout.CENTER);
                return panel;
            case JOG_FEEDRATE_OVERRIDE:
                panel = NewComp.getPanel(new BorderLayout());
                JLabel jogFOLabel = NewComp.getLabel("jogFeedrateO","titleLabelBFrame","black");
                JSlider jogFOSlider = NewComp.getSlider(0,120,jogFeedrateO.intValue());
                jogFOSlider.addChangeListener( new
                    ChangeListener()
                    {
                        public void stateChanged(ChangeEvent event)
                        {
                            JSlider aux = (JSlider) event.getSource();
                            InfoManager.addCommand(KbdCmdId.CmdId.FEEDRATE_OVERRIDE, aux.getValue());
                        }
                    }
                );
                panel_aux1 = new JPanel();
                panel_aux2 = new JPanel();
                panel_aux1.add(jogFOLabel);
                panel_aux2.add(jogFOSlider);
                panel.add(panel_aux1,BorderLayout.NORTH);
                panel.add(panel_aux2,BorderLayout.CENTER);
                return panel;
            case HANDWHEEL_FACTOR:
                group = new ButtonGroup();
                panel = NewComp.getPanel("handwheelFactor","titleBorderBFrame",new GridLayout(1,3));
                JRadioButton handwheelFOne =NewComp.getRadioButton( 
                    "handwheelF1", 
                    "titleRButton", 
                    "blue",
                    handwheelF == HandwheelF.HF_1, 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.HANDWHEEL, KbdCmdId.CmdValue.HANDWHEEL_FACTOR_1);
                        }
                    }
                );
                JRadioButton handwheelFTen =NewComp.getRadioButton( 
                    "handwheelF10", 
                    "titleRButton",
                    "blue",
                    handwheelF == HandwheelF.HF_10, 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.HANDWHEEL, KbdCmdId.CmdValue.HANDWHEEL_FACTOR_10);
                        }
                    }
                );
                JRadioButton handwheelFHundred =NewComp.getRadioButton( 
                    "handwheelF100", 
                    "titleRButton",
                    "blue",
                    handwheelF == HandwheelF.HF_100, 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.HANDWHEEL, KbdCmdId.CmdValue.HANDWHEEL_FACTOR_100);
                        }
                    }
                );
                group.add(handwheelFOne);
                group.add(handwheelFTen);
                group.add(handwheelFHundred);
                panel.add(handwheelFOne);
                panel.add(handwheelFTen);
                panel.add(handwheelFHundred);
                return panel;
            case HANDWHEEL_AXIS:
                group = new ButtonGroup();
                panel = NewComp.getPanel("handwheelAxis","titleBorderBFrame",new GridLayout(1,3));
                JRadioButton handwheelAX =NewComp.getRadioButton( 
                    "handwheelAX", 
                    "titleRButton",
                    "blue",
                    handwheelA == HandwheelA.HA_X, 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.HANDWHEEL, KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_X);
                        }
                    }
                );
                JRadioButton handwheelAY =NewComp.getRadioButton( 
                    "handwheelAY", 
                    "titleRButton",
                    "blue",
                    handwheelA == HandwheelA.HA_Y, 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.HANDWHEEL, KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_Y);
                        }
                    }
                );
                JRadioButton handwheelAZ =NewComp.getRadioButton( 
                    "handwheelAZ", 
                    "titleRButton",
                    "blue",
                    handwheelA == HandwheelA.HA_Z, 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.HANDWHEEL, KbdCmdId.CmdValue.HANDWHEEL_SELECT_AXIS_Z);
                        }
                    }
                );
                group.add(handwheelAX);
                group.add(handwheelAY);
                group.add(handwheelAZ);
                panel.add(handwheelAX);
                panel.add(handwheelAY);
                panel.add(handwheelAZ);
                return panel;
            case CUTTING_DATA_EDITOR:
                panel = NewComp.getPanel("cuttingFeedrate","titleBorderBFrame",new GridLayout(2,2));
                JLabel dfltCutLabel = NewComp.getLabel("defaultCutting","titleLabelBFrame","black");
                JLabel maxCutLabel = NewComp.getLabel("maximumCutting","titleLabelBFrame","black");
                dfltCutField = NewComp.getNumberTxtField("textFieldNumBFrame");
                dfltCutField.setValue(toMmOrIn(PathPlanning.getMetricSystem(),dfltCutFeedrate));
                dfltCutField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.DEFAULT_CUTTING_FEEDRATE) == -1)
                                changed.add(Id.DEFAULT_CUTTING_FEEDRATE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.DEFAULT_CUTTING_FEEDRATE) == -1)
                                changed.add(Id.DEFAULT_CUTTING_FEEDRATE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                maxCutField = NewComp.getNumberTxtField("textFieldNumBFrame");
                maxCutField.setValue(toMmOrIn(PathPlanning.getMetricSystem(),maxCutFeedrate));
                maxCutField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.MAXIMUM_CUTTING_FEEDRATE) == -1)
                                changed.add(Id.MAXIMUM_CUTTING_FEEDRATE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.MAXIMUM_CUTTING_FEEDRATE) == -1)
                                changed.add(Id.MAXIMUM_CUTTING_FEEDRATE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                panel_aux1 = new JPanel(new GridBagLayout());
                panel_aux2 = new JPanel(new GridBagLayout());
                panel_aux1.add(dfltCutField,new GridBagConstraints());
                panel_aux2.add(maxCutField,new GridBagConstraints());
                panel.add(dfltCutLabel);
                panel.add(panel_aux1);
                panel.add(maxCutLabel);
                panel.add(panel_aux2);
                return panel;
            case JOG_DATA_EDITOR:
                panel = NewComp.getPanel("jogFeedrate","titleBorderBFrame",new GridLayout(2,2));
                JLabel dfltJogLabel = NewComp.getLabel("defaultJog","titleLabelBFrame","black");
                JLabel maxJogLabel = NewComp.getLabel("maximumJog","titleLabelBFrame","black");
                dfltJogField = NewComp.getIntegerTxtField("textFieldNumBFrame");
                dfltJogField.setValue(toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    jogFeedrate.longValue())
                );
                dfltJogField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.JOG_FEEDRATE) == -1)
                                changed.add(Id.JOG_FEEDRATE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.JOG_FEEDRATE) == -1)
                                changed.add(Id.JOG_FEEDRATE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                maxJogField = NewComp.getIntegerTxtField("textFieldNumBFrame");
                maxJogField.setValue((int)toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    maxJogFeedrate)
                );
                maxJogField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.MAXIMUM_JOG_FEEDRATE) == -1)
                                changed.add(Id.MAXIMUM_JOG_FEEDRATE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.MAXIMUM_JOG_FEEDRATE) == -1)
                                changed.add(Id.MAXIMUM_JOG_FEEDRATE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                panel_aux1 = new JPanel(new GridBagLayout());
                panel_aux2 = new JPanel(new GridBagLayout());
                panel_aux1.add(dfltJogField,new GridBagConstraints());
                panel_aux2.add(maxJogField,new GridBagConstraints());
                panel.add(dfltJogLabel);
                panel.add(panel_aux1);
                panel.add(maxJogLabel);
                panel.add(panel_aux2);
                return panel;
            case RTR_DATA_EDITOR:
                panel = NewComp.getPanel("rapidTraverseRate","titleBorderBFrame",new GridLayout(2,2));
                JLabel rapidTRLabel_ = NewComp.getLabel("rapidTraverseRate","titleLabelBFrame","black");
                JLabel rapidTROLabel = NewComp.getLabel("userRapidTRO","titleLabelBFrame","black");
                JLabel maxRapidTRLabel = NewComp.getLabel("maxRapidTraverseRate","titleLabelBFrame","black");
                rapidTRField = NewComp.getNumberTxtField("textFieldNumBFrame");
                rapidTRField.setValue((int)toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    rapidTR)
                );
                rapidTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.RAPID_TRAVERSE_RATE) == -1)
                                changed.add(Id.RAPID_TRAVERSE_RATE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.RAPID_TRAVERSE_RATE) == -1)
                                changed.add(Id.RAPID_TRAVERSE_RATE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                JFormattedTextField rapidTROField = 
                    NewComp.getIntegerTxtField("textFieldNumBFrame");
                maxRapidTRField = NewComp.getIntegerTxtField("textFieldNumBFrame");
                maxRapidTRField.setValue((int)toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    maxRapidTR)
                );
                maxRapidTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.MAXIMUM_TRAVERSE_RATE) == -1)
                                changed.add(Id.MAXIMUM_TRAVERSE_RATE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.MAXIMUM_TRAVERSE_RATE) == -1)
                                changed.add(Id.MAXIMUM_TRAVERSE_RATE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                panel_aux1 = new JPanel(new GridBagLayout());
                panel_aux2 = new JPanel(new GridBagLayout());
                panel_aux1.add(rapidTRField,new GridBagConstraints());
                panel_aux2.add(maxRapidTRField,new GridBagConstraints());
                panel.add(rapidTRLabel_);
                panel.add(panel_aux1);
                panel.add(maxRapidTRLabel);
                panel.add(panel_aux2);
                return panel;
            case ZRTR_DATA_EDITOR:
                panel = NewComp.getPanel("zeroReturnTraverseRate","titleBorderBFrame",new GridLayout(1,2));
                JLabel fastZRTRLabel = NewComp.getLabel("fastZRTR","titleLabelBFrame","black");
                JLabel slowZRTRLabel = NewComp.getLabel("slowZRTR","titleLabelBFrame","black");
                fastZRTRField = NewComp.getNumberTxtField("textFieldNumBFrame");
                fastZRTRField.setValue((int)toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    fastZRTR)
                );
                fastZRTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.FAST_ZRTR) == -1)
                                changed.add(Id.FAST_ZRTR);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.FAST_ZRTR) == -1)
                                changed.add(Id.FAST_ZRTR);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                slowZRTRField = NewComp.getNumberTxtField("textFieldNumBFrame");
                slowZRTRField.setValue((int)toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    slowZRTR)
                );
                slowZRTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.SLOW_ZRTR) == -1)
                                changed.add(Id.SLOW_ZRTR);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.SLOW_ZRTR) == -1)
                                changed.add(Id.SLOW_ZRTR);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                panel_aux1 = new JPanel(new GridBagLayout());
                panel_aux1.add(fastZRTRField,new GridBagConstraints());
                panel.add(fastZRTRLabel);
                panel.add(panel_aux1);
                return panel;
            case AXIS_MOTION_TRAVEL_RANGE:
                panel = NewComp.getPanel("motionTravelRange","titleBorderBFrame",new GridLayout(3,2));
                panel_aux1 = new JPanel(new GridBagLayout());
                panel_aux2 = new JPanel(new GridBagLayout());
                panel_aux3 = new JPanel(new GridBagLayout());
                JLabel xLabel = NewComp.getLabel("x","titleLabelBFrame","black");
                JLabel yLabel = NewComp.getLabel("y","titleLabelBFrame","black");
                JLabel zLabel = NewComp.getLabel("z","titleLabelBFrame","black");
                xAMTRField = NewComp.getNumberTxtField("textFieldNumBFrame");
                xAMTRField.setValue(toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    xAMTR)
                );
                xAMTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.X_AXIS_MOTION_TRAVEL_RANGE) == -1)
                                changed.add(Id.X_AXIS_MOTION_TRAVEL_RANGE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.X_AXIS_MOTION_TRAVEL_RANGE) == -1)
                                changed.add(Id.X_AXIS_MOTION_TRAVEL_RANGE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                yAMTRField = NewComp.getNumberTxtField("textFieldNumBFrame");
                yAMTRField.setValue(toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    yAMTR)
                );
                yAMTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.Y_AXIS_MOTION_TRAVEL_RANGE) == -1)
                                changed.add(Id.Y_AXIS_MOTION_TRAVEL_RANGE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.Y_AXIS_MOTION_TRAVEL_RANGE) == -1)
                                changed.add(Id.Y_AXIS_MOTION_TRAVEL_RANGE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                zAMTRField = NewComp.getNumberTxtField("textFieldNumBFrame");
                zAMTRField.setValue(toMmOrIn(
                    PathPlanning.getMetricSystem(),
                    zAMTR)
                );
                zAMTRField.getDocument().addDocumentListener(
                    new DocumentListener() 
                    {
                        public void insertUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.Z_AXIS_MOTION_TRAVEL_RANGE) == -1)
                                changed.add(Id.Z_AXIS_MOTION_TRAVEL_RANGE);
                        }
                        public void removeUpdate(DocumentEvent event) 
                        {
                            if(changed.lastIndexOf(Id.Z_AXIS_MOTION_TRAVEL_RANGE) == -1)
                                changed.add(Id.Z_AXIS_MOTION_TRAVEL_RANGE);
                        }
                        public void changedUpdate(DocumentEvent event){}
                    }
                );
                panel_aux1.add(xAMTRField,new GridBagConstraints());
                panel_aux2.add(yAMTRField,new GridBagConstraints());
                panel_aux3.add(zAMTRField,new GridBagConstraints());
                panel.add(xLabel);
                panel.add(panel_aux1);
                panel.add(yLabel);
                panel.add(panel_aux2);
                panel.add(zLabel);
                panel.add(panel_aux3);
                return panel;
            case AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                xARPRD_Aux = xARPRD;
                yARPRD_Aux = yARPRD;
                zARPRD_Aux = zARPRD;
                panel = NewComp.getPanel("refrencePointReturnDirection","titleBorderBFrame",new GridLayout(3,3));
                JLabel xAxisLabel = NewComp.getLabel("x", "titleLabelBFrame", "black");
                JLabel yAxisLabel = NewComp.getLabel("y", "titleLabelBFrame", "black");
                JLabel zAxisLabel = NewComp.getLabel("z", "titleLabelBFrame", "black");
                xNButton =NewComp.getRadioButton( 
                    "negative", 
                    "titleRButton",
                    "blue",
                    arprdOpt[xARPRD].equals("negative"), 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            xARPRD_Aux = Integer.valueOf(0);
                            if(changed.lastIndexOf(Id.X_AXIS_REFERENCE_POINT_RETURN_DIRECTION) == -1)
                                changed.add(Id.X_AXIS_REFERENCE_POINT_RETURN_DIRECTION);
                        }
                    }
                );
                xPButton =NewComp.getRadioButton( 
                    "positive", 
                    "titleRButton",
                    "blue",
                    arprdOpt[xARPRD].equals("positive"), 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            xARPRD_Aux = Integer.valueOf(1);
                            if(changed.lastIndexOf(Id.X_AXIS_REFERENCE_POINT_RETURN_DIRECTION) == -1)
                                changed.add(Id.X_AXIS_REFERENCE_POINT_RETURN_DIRECTION);
                        }
                    }
                );
                yNButton =NewComp.getRadioButton( 
                    "negative", 
                    "titleRButton",
                    "blue",
                    arprdOpt[yARPRD].equals("negative"), 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            yARPRD_Aux = Integer.valueOf(0);
                            if(changed.lastIndexOf(Id.Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION) == -1)
                                changed.add(Id.Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION);
                        }
                    }
                );
                yPButton =NewComp.getRadioButton( 
                    "positive", 
                    "titleRButton",
                    "blue",
                    arprdOpt[yARPRD].equals("positive"), 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            yARPRD_Aux = Integer.valueOf(1);
                            if(changed.lastIndexOf(Id.Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION) == -1)
                                changed.add(Id.Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION);
                        }
                    }
                );
                zNButton =NewComp.getRadioButton( 
                    "negative", 
                    "titleRButton",
                    "blue",
                    arprdOpt[zARPRD].equals("negative"), 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            zARPRD_Aux = Integer.valueOf(0);
                            if(changed.lastIndexOf(Id.Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION) == -1)
                                changed.add(Id.Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION);
                        }
                    }
                );
                zPButton =NewComp.getRadioButton( 
                    "positive", 
                    "titleRButton",
                    "blue",
                    arprdOpt[zARPRD].equals("positive"), 
                    new ActionListener()
                    {
                        public void actionPerformed(ActionEvent event)
                        {
                            zARPRD_Aux = Integer.valueOf(1);
                            if(changed.lastIndexOf(Id.Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION) == -1)
                                changed.add(Id.Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION);
                        }
                    }
                );
                panel_aux1 = new JPanel(new GridLayout(1,2));
                panel_aux2 = new JPanel(new GridLayout(1,2));
                panel_aux3 = new JPanel(new GridLayout(1,2));
                ButtonGroup xGroup = new ButtonGroup();
                ButtonGroup yGroup = new ButtonGroup();
                ButtonGroup zGroup = new ButtonGroup();
                xGroup.add(xNButton);
                xGroup.add(xPButton);
                yGroup.add(yNButton);
                yGroup.add(yPButton);
                zGroup.add(zNButton);
                zGroup.add(zPButton);
                panel.add(xAxisLabel);
                panel.add(xNButton);
                panel.add(xPButton);
                panel.add(yAxisLabel);
                panel.add(yNButton);
                panel.add(yPButton);
                panel.add(zAxisLabel);
                panel.add(zNButton);
                panel.add(zPButton);
                return panel;
            case JOG_AXES:
                panel = NewComp.getPanel("jogAxes","titleBorderBFrame",new GridLayout(3,3));
                //JLabel xJogAxesLabel = NewComp.getLabel("x", "titleLabelBFrame", "black");
                //JLabel yJogAxesLabel = NewComp.getLabel("y", "titleLabelBFrame", "black");
                //JLabel zJogAxesLabel = NewComp.getLabel("z", "titleLabelBFrame", "black");
                JButton jXANButton =NewComp.getButton( 
                    "negative_x", 
                    new MouseListener()
                    {
                        public void mouseClicked(MouseEvent e) {}
                        public void mouseEntered(MouseEvent e) {}
                        public void mouseExited(MouseEvent e) {}
                        public void mousePressed(MouseEvent e) 
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_X_NEGATIVE_SELECT);
                        }
                        public void mouseReleased(MouseEvent e)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_X_NEGATIVE_IGNORE);
                        }
                    }
                );
                JButton jXAPButton =NewComp.getButton( 
                    "positive_x",  
                    new MouseListener()
                    {
                        public void mouseClicked(MouseEvent e) {}
                        public void mouseEntered(MouseEvent e) {}
                        public void mouseExited(MouseEvent e) {}
                        public void mousePressed(MouseEvent e) 
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_X_POSITIVE_SELECT);
                        }
                        public void mouseReleased(MouseEvent e)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_X_POSITIVE_IGNORE);
                        }
                    }
                );
                
                JButton jYANButton =NewComp.getButton( 
                    "negative_y", 
                    new MouseListener()
                    {
                        public void mouseClicked(MouseEvent e) {}
                        public void mouseEntered(MouseEvent e) {}
                        public void mouseExited(MouseEvent e) {}
                        public void mousePressed(MouseEvent e) 
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Y_NEGATIVE_SELECT);
                        }
                        public void mouseReleased(MouseEvent e)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Y_NEGATIVE_IGNORE);
                        }
                    }
                );
                JButton jYAPButton =NewComp.getButton( 
                    "positive_y",  
                    new MouseListener()
                    {
                        public void mouseClicked(MouseEvent e) {}
                        public void mouseEntered(MouseEvent e) {}
                        public void mouseExited(MouseEvent e) {}
                        public void mousePressed(MouseEvent e) 
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Y_POSITIVE_SELECT);
                        }
                        public void mouseReleased(MouseEvent e)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Y_POSITIVE_IGNORE);
                        }
                    }
                );
                JButton jZANButton =NewComp.getButton( 
                    "negative_z",  
                    new MouseListener()
                    {
                        public void mouseClicked(MouseEvent e) {}
                        public void mouseEntered(MouseEvent e) {}
                        public void mouseExited(MouseEvent e) {}
                        public void mousePressed(MouseEvent e) 
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Z_NEGATIVE_SELECT);
                        }
                        public void mouseReleased(MouseEvent e)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Z_NEGATIVE_IGNORE);
                        }
                    }
                );
                JButton jZAPButton =NewComp.getButton( 
                    "positive_z",  
                    new MouseListener()
                    {
                        public void mouseClicked(MouseEvent e) {}
                        public void mouseEntered(MouseEvent e) {}
                        public void mouseExited(MouseEvent e) {}
                        public void mousePressed(MouseEvent e) 
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Z_POSITIVE_SELECT);
                        }
                        public void mouseReleased(MouseEvent e)
                        {
                            InfoManager.addCommand(KbdCmdId.CmdId.AXIS, KbdCmdId.CmdValue.AXIS_Z_POSITIVE_IGNORE);
                        }
                    }
                );
                panel_aux1 = new JPanel();
                panel_aux2 = new JPanel();
                panel_aux3 = new JPanel();
                ButtonGroup xJGroup = new ButtonGroup();
                ButtonGroup yJGroup = new ButtonGroup();
                ButtonGroup zJGroup = new ButtonGroup();
                xJGroup.add(jXANButton);
                xJGroup.add(jXAPButton);
                yJGroup.add(jYANButton);
                yJGroup.add(jYAPButton);
                zJGroup.add(jZANButton);
                zJGroup.add(jZAPButton);
                panel.add(jZAPButton);
                panel.add(jXAPButton);
                panel.add(panel_aux1);
                panel.add(jYANButton);
                panel.add(panel_aux2);
                panel.add(jYAPButton);
                panel.add(panel_aux3);
                panel.add(jXANButton);
                panel.add(jZANButton);
                return panel;
            default:
                return null;
        }
    }
    public String getDataCategoryID()
    {
        return "axisMotion";
    }
    public String getValue(Id dataID)
    {
        
        return null;
    }
    public boolean setCommandValue(int id,int value)
    {
        if(!initData( id, value))
            return false;
        switch(id)
        {
            case KbdCmdId.CmdId.JOG_FEEDRATE:
                fField.setValue(Integer.valueOf(
                    (int)toMmOrIn(
                        PathPlanning.getMetricSystem(),
                        getFeedrate()
                    )
                ));
                break;
        }
        return true;
    }
    public boolean setCommandValue(int id,long value)
    {
        if(!initData( id, value))
            return false;
        switch(id)
        {
            case KbdCmdId.CmdId.JOG_FEEDRATE:
                fField.setValue(Integer.valueOf(
                    (int)toMmOrIn(
                        PathPlanning.getMetricSystem(),
                        getFeedrate()
                    )
                ));
                break;
        }
        return true;
    }
    public boolean setDataValue(int id,int value)
    {
        if(!initData( id, value))
            return false;
        switch(id)
        {
            case CUTTING_MODE:
                cuttingModeField.setText(
                    NewComp.getString(cuttingModeOpt[cuttingMode]));
                break;
            case JOG_FEEDRATE:
            //NewComp.proofFrame.addText("setCommand id = "+ id +" "+"value = "+ value +"");
            case CUTTING_FEEDRATE:
                fField.setValue(Integer.valueOf(
                    (int)toMmOrIn(
                        PathPlanning.getMetricSystem(),
                        getFeedrate()
                    )
                ));
                break;
            case RAPID_TRAVERSE_RATE_OVERRIDE:
            case JOG_FEEDRATE_OVERRIDE:
            case CUTTING_FEEDRATE_OVERRIDE:
                fBar.setValue(getOverride());
                fBar.setString(""+getOverride()+"%");
                break;
            case X_LEFT_AXIS_HARD_LIMIT_SWITCH:
                aLHLSIcon[0].setIcon(
                    NewComp.getIcon(axisHLSOpt[xALHLS]));
                break;
            case X_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                aRHLSIcon[0].setIcon(
                    NewComp.getIcon(axisHLSOpt[xARHLS]));
                break;
            case Y_LEFT_AXIS_HARD_LIMIT_SWITCH:
                aLHLSIcon[1].setIcon(
                    NewComp.getIcon(axisHLSOpt[yALHLS]));
                break;
            case Y_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                aRHLSIcon[1].setIcon(
                    NewComp.getIcon(axisHLSOpt[yARHLS]));
                break;
            case Z_LEFT_AXIS_HARD_LIMIT_SWITCH:
                aLHLSIcon[2].setIcon(
                    NewComp.getIcon(axisHLSOpt[zALHLS]));
                break;
            case Z_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                aRHLSIcon[2].setIcon(
                    NewComp.getIcon(axisHLSOpt[zARHLS]));
                break;
            case X_AXIS_CURRENT_POSITION:
                xACPField.setValue(Integer.valueOf(value));
                break;
            case Y_AXIS_CURRENT_POSITION:
                yACPField.setValue(Integer.valueOf(value));
                break;
            case Z_AXIS_CURRENT_POSITION:
                zACPField.setValue(Integer.valueOf(value));
                break;
        }
        return true;
    }
    public boolean setDataValue(int id,long value)
    {
        if(!initData( id, value))
            return false;
        switch(id)
        {
            case CUTTING_MODE:
                cuttingModeField.setText(
                    NewComp.getString(cuttingModeOpt[cuttingMode]));
                break;
            case JOG_FEEDRATE:
            //NewComp.proofFrame.addText("setCommand id = "+ id +" "+"value = "+ value +"");
            case CUTTING_FEEDRATE:
                fField.setValue(Integer.valueOf(
                    (int)toMmOrIn(
                        PathPlanning.getMetricSystem(),
                        getFeedrate()
                    )
                ));
                break;
            case RAPID_TRAVERSE_RATE_OVERRIDE:
            case JOG_FEEDRATE_OVERRIDE:
            case CUTTING_FEEDRATE_OVERRIDE:
                fBar.setValue(getOverride());
                fBar.setString(""+getOverride()+"%");
                break;
            case X_LEFT_AXIS_HARD_LIMIT_SWITCH:
                aLHLSIcon[0].setIcon(
                    NewComp.getIcon(axisHLSOpt[xALHLS]));
                break;
            case X_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                aRHLSIcon[0].setIcon(
                    NewComp.getIcon(axisHLSOpt[xARHLS]));
                break;
            case Y_LEFT_AXIS_HARD_LIMIT_SWITCH:
                aLHLSIcon[1].setIcon(
                    NewComp.getIcon(axisHLSOpt[yALHLS]));
                break;
            case Y_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                aRHLSIcon[1].setIcon(
                    NewComp.getIcon(axisHLSOpt[yARHLS]));
                break;
            case Z_LEFT_AXIS_HARD_LIMIT_SWITCH:
                aLHLSIcon[2].setIcon(
                    NewComp.getIcon(axisHLSOpt[zALHLS]));
                break;
            case Z_RIGHT_AXIS_HARD_LIMIT_SWITCH:
                aRHLSIcon[2].setIcon(
                    NewComp.getIcon(axisHLSOpt[zARHLS]));
                break;
            /*case X_AXIS_CURRENT_POSITION:
                xACPField.setValue(Integer.valueOf(value));
                break;
            case Y_AXIS_CURRENT_POSITION:
                yACPField.setValue(Integer.valueOf(value));
                break;
            case Z_AXIS_CURRENT_POSITION:
                zACPField.setValue(Integer.valueOf(value));
                break;*/
        }
        return true;
    }
    public void applyChange()
    {
        long aux = 0;
        while( changed.isEmpty() == false)
        {
            switch(changed.get(0))
            {
                case DEFAULT_CUTTING_FEEDRATE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)dfltCutField.getValue()).floatValue())
                    );
                    if((aux < 0)||(aux > maxCutFeedrate))
                    {
                        dfltCutField.setValue(toMmOrIn(PathPlanning.getMetricSystem(),dfltCutFeedrate));
                        dfltCutField.requestFocus();
                        return;
                    }else
                    {
                        dfltCutFeedrate = Long.valueOf(aux);
                        InfoManager.addDataValue(
                            DEFAULT_CUTTING_FEEDRATE,
                            dfltCutFeedrate
                        );
                    }
                    break;
                case MAXIMUM_CUTTING_FEEDRATE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)maxCutField.getValue()).floatValue())
                    );
                    if((aux < 0)||(dfltCutFeedrate > maxCutFeedrate)||(aux > MAX_UINT_32))
                    {
                        maxCutField.setValue(toMmOrIn(PathPlanning.getMetricSystem(),maxCutFeedrate));
                        maxCutField.requestFocus();
                        return;
                    }else
                    {
                        maxCutFeedrate = aux;    
                        InfoManager.addDataValue(
                            MAXIMUM_CUTTING_FEEDRATE, 
                            maxCutFeedrate
                        );
                    }
                    break;
                case JOG_FEEDRATE:
                    aux = toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)dfltJogField.getValue()).floatValue()
                    );
                    if((aux < 0) || (maxJogFeedrate < aux))
                    {
                        dfltJogField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                jogFeedrate
                            )
                        );
                        dfltJogField.requestFocus();
                        return;
                    } else
                    {
                        jogFeedrate = aux;
                        InfoManager.addDataValue(
                            KbdCmdId.CmdId.JOG_FEEDRATE, 
                            jogFeedrate
                        );
                    }
                    break;
                case MAXIMUM_JOG_FEEDRATE:
                    aux = toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)maxJogField.getValue()).floatValue()
                    );
                    if((aux < 0)||(aux < jogFeedrate)||(aux > MAX_UINT_32))
                    {
                        maxJogField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                maxJogFeedrate
                            )
                        );
                        maxJogField.requestFocus();
                        return;
                    }else
                    {
                        maxJogFeedrate = Long.valueOf(aux);
                        InfoManager.addDataValue(
                            MAXIMUM_JOG_FEEDRATE, 
                            maxJogFeedrate
                        );
                    }
                    break;
                case RAPID_TRAVERSE_RATE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)rapidTRField.getValue()).floatValue())
                    );
                    if((aux < 0)||(aux > maxRapidTR))
                    {
                        rapidTRField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                rapidTR
                            )
                        );
                        rapidTRField.requestFocus();
                        return;
                    }else
                    {
                        rapidTR = aux;
                        InfoManager.addDataValue(
                            RAPID_TRAVERSE_RATE, 
                            rapidTR
                        );
                    }
                    break;
                case FAST_ZRTR:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)fastZRTRField.getValue()).floatValue())
                    );
                    if((aux < 0)||(aux > MAX_UINT_32))
                    {
                        fastZRTRField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                fastZRTR
                            )
                        );
                        fastZRTRField.requestFocus();
                        return;
                    }else
                    {
                        fastZRTR = aux;
                        InfoManager.addDataValue(
                            FAST_ZRTR, 
                            fastZRTR
                        );
                    }
                    break;
                case MAXIMUM_TRAVERSE_RATE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)maxRapidTRField.getValue()).floatValue())
                    );
                    if((aux < 0)||(aux < rapidTR)||(MAX_UINT_32 < aux))
                    {
                        maxRapidTRField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                maxRapidTR
                            )
                        );
                        maxRapidTRField.requestFocus();
                        return;
                    }else
                    {
                        maxRapidTR = aux;
                        InfoManager.addDataValue(
                            MAXIMUM_TRAVERSE_RATE, 
                            maxRapidTR
                        );
                    }
                    break;
                case X_AXIS_MOTION_TRAVEL_RANGE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)xAMTRField.getValue()).floatValue())
                    );
                    if((aux < 0L)||((long)Integer.MAX_VALUE < aux))
                    {
                       xAMTRField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                xAMTR
                            )
                        );
                        xAMTRField.requestFocus();
                        return;
                    }else
                    {
                        xAMTR = (int)aux;
                        InfoManager.addDataValue(
                            X_AXIS_MOTION_TRAVEL_RANGE, 
                            xAMTR
                        );
                    }
                    break;
                case Y_AXIS_MOTION_TRAVEL_RANGE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)yAMTRField.getValue()).floatValue())
                    );
                    if((aux < 0L)||((long)Integer.MAX_VALUE < aux))
                    {
                       yAMTRField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                yAMTR
                            )
                        );
                        yAMTRField.requestFocus();
                        return;
                    }else
                    {
                        yAMTR = (int)aux;
                        InfoManager.addDataValue(
                            Y_AXIS_MOTION_TRAVEL_RANGE, 
                            yAMTR
                        );
                    }
                    break;
                case Z_AXIS_MOTION_TRAVEL_RANGE:
                    aux = Long.valueOf(toNm(
                        PathPlanning.getMetricSystem(),
                        ((Number)zAMTRField.getValue()).floatValue())
                    );
                    if((aux < 0L)||((long)Integer.MAX_VALUE < aux))
                    {
                       zAMTRField.setValue(
                                toMmOrIn(
                                PathPlanning.getMetricSystem(),
                                zAMTR
                            )
                        );
                        zAMTRField.requestFocus();
                        return;
                    }else
                    {
                        zAMTR = (int)aux;
                        InfoManager.addDataValue(
                            Z_AXIS_MOTION_TRAVEL_RANGE, 
                            zAMTR
                        );
                    }
                    break;
                case X_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    xARPRD = xARPRD_Aux;
                    InfoManager.addDataValue(
                        X_AXIS_REFERENCE_POINT_RETURN_DIRECTION,
                        xARPRD
                    );
                    break;
                case Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    yARPRD = yARPRD_Aux;
                    InfoManager.addDataValue(
                        Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION,
                        yARPRD
                    );
                    break;
                case Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    zARPRD = zARPRD_Aux;
                    InfoManager.addDataValue(
                        Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION,
                        zARPRD
                    );
                    break;
                case OTHER:
                    break;
                default:
                    break;
            }
            changed.remove(0);
        }
    }
    public void cancelChange()
    {
        while( changed.isEmpty() == false)
        {
            switch(changed.get(0))
            {
                case DEFAULT_CUTTING_FEEDRATE:
                    dfltCutField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            dfltCutFeedrate
                        )
                    );
                    break;
                case MAXIMUM_CUTTING_FEEDRATE:
                    maxCutField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            maxCutFeedrate
                        )
                    );
                    break;
                case JOG_FEEDRATE:
                    dfltJogField.setValue(
                            toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            jogFeedrate
                        )
                    );
                    break;
                case MAXIMUM_JOG_FEEDRATE:
                    maxJogField.setValue(
                        (int)toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            maxJogFeedrate
                        )
                    );
                    break;
                case RAPID_TRAVERSE_RATE:
                    rapidTRField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            rapidTR
                        )
                    );
                    break;
                case FAST_ZRTR:
                    fastZRTRField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            fastZRTR
                        )
                    );
                    break;
                case MAXIMUM_TRAVERSE_RATE:
                    maxRapidTRField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            maxRapidTR
                        )
                    );
                    break;
                case X_AXIS_MOTION_TRAVEL_RANGE:
                    xAMTRField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            xAMTR
                        )
                    );
                    break;
                case Y_AXIS_MOTION_TRAVEL_RANGE:
                    yAMTRField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            yAMTR
                        )
                    );
                    break;
                case Z_AXIS_MOTION_TRAVEL_RANGE:
                    zAMTRField.setValue(
                        toMmOrIn(
                            PathPlanning.getMetricSystem(),
                            zAMTR
                        )
                    );
                    break;
                case X_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    xARPRD_Aux = xARPRD;
                    if(arprdOpt[xARPRD].equals("negative"))
                        xNButton.setSelected(true);
                    else
                        xPButton.setSelected(true);
                    break;
                case Y_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    yARPRD_Aux = yARPRD;
                    if(arprdOpt[yARPRD].equals("negative"))
                        yNButton.setSelected(true);
                    else
                        yPButton.setSelected(true);
                    break;
                case Z_AXIS_REFERENCE_POINT_RETURN_DIRECTION:
                    zARPRD_Aux = zARPRD;
                    if(arprdOpt[zARPRD].equals("negative"))
                        zNButton.setSelected(true);
                    else
                        zPButton.setSelected(true);
                    break;
                case OTHER:
                    break;
                default:
                    break;
            }
            changed.remove(0);
        }
        if(!changed.isEmpty())
            changed.clear();
    }
    private int getFeedrate()
    {
        String motionType = PathPlanning.getMotionType();
        String operationMode = MachineOperation.getOperationMode();
        if(operationMode.equals("zeroReturnMode"))
            return fastZRTR.intValue();
        if(motionType.equals("linear")||operationMode.equals("jogMode"))
            return jogFeedrate.intValue();
        if(motionType.equals("rapid")||operationMode.equals("rapidMode"))
            return rapidTR.intValue();
        if(motionType.equals("clockwise")||motionType.equals("counterClockwise"))
            return cutFeedrate.intValue();
        else
            return 0;
    }
    private int getOverride()
    {
        String motionType = PathPlanning.getMotionType();
        String operationMode = MachineOperation.getOperationMode();
        if(operationMode.equals("zeroReturnMode"))
            return 100;
        if(motionType.equals("linear")||operationMode.equals("jogMode"))
            return jogFeedrateO.intValue();
        if(motionType.equals("rapid")||operationMode.equals("rapidMode"))
            return rapidTRO.intValue();
        if(motionType.equals("clockwise")||motionType.equals("counterClockwise"))
            return cutFeedrateO.intValue();
        return 0;
    }
    private int getMaximum()
    {
        return 120;
    }
    private int getMinimum()
    {
        return 0;
    }
    static
    {
        handwheelF = null;
        handwheelA = null;
        cuttingMode = new Integer(0);
        maxCutFeedrate = new Long(0);
        cutFeedrate = new Long(0);
        dfltCutFeedrate = new Long(0);
        cutFeedrateO = new Integer(0);
        maxRapidTR = new Long(0);
        rapidTR = new Long(0);
        rapidTRO = new Integer(0);
        jogFeedrate = new Long(10);
        maxJogFeedrate = new Long(10);
        jogFeedrateO = new Integer(0);
        xALHLS = new Integer(0);
        xARHLS = new Integer(0);
        yALHLS = new Integer(0);
        yARHLS = new Integer(0);
        zALHLS = new Integer(0);
        zARHLS = new Integer(0);
        xAMTR = new Integer(0);
        yAMTR = new Integer(0);
        zAMTR = new Integer(0);
        xACP = new Integer(0);
        yACP = new Integer(0);
        zACP = new Integer(0);
        fastZRTR = new Long(0);
        slowZRTR = new Long(0);
        xARPRD = new Integer(0);
        yARPRD = new Integer(0);
        zARPRD = new Integer(0);
        xARPRD_Aux = new Integer(0);
        yARPRD_Aux = new Integer(0);
        zARPRD_Aux = new Integer(0);
        fField = NewComp.getFTF( 4, "textFieldNumTFrame");
        fBar = NewComp.getProgressBar("textBar");
        aLHLSIcon = new JLabel[3];
        aRHLSIcon = new JLabel[3];
    }
    private enum HandwheelF
    {
        HF_1,
        HF_10,
        HF_100;
    }
    private enum HandwheelA
    {
        HA_X,
        HA_Y,
        HA_Z;
    }
    private static final String[] cuttingModeOpt = {
        "normal",
        "exactStop",
        "automaticCornerOverride",
        "tapping"
    };
    private static final String[] axisHLSOpt = {
        "enabled",
        "disabled"
    };
    private static final String[] arprdOpt = {"negative","positive"};
    private static HandwheelF handwheelF;
    private static HandwheelA handwheelA;
    private static Integer cuttingMode;
    private static Long maxCutFeedrate;
    private static JFormattedTextField maxCutField;
    private static Long cutFeedrate;
    private static Long dfltCutFeedrate;
    private static JFormattedTextField dfltCutField;
    private static Integer cutFeedrateO;
    private static Long maxRapidTR;
    private static JFormattedTextField maxRapidTRField;
    private static Long rapidTR;
    private static JFormattedTextField rapidTRField;
    private static Integer rapidTRO;
    private static Long jogFeedrate;
    private static JFormattedTextField dfltJogField;
    private static Long maxJogFeedrate;
    private static JFormattedTextField maxJogField;
    private static Integer jogFeedrateO;
    private static Integer xALHLS;
    private static Integer xARHLS;
    private static Integer yALHLS;
    private static Integer yARHLS;
    private static Integer zALHLS;
    private static Integer zARHLS;
    private static Integer xAMTR;
    private static Integer yAMTR;
    private static Integer zAMTR;
    private static Integer xACP;
    private static Integer yACP;
    private static Integer zACP;
    private static Long fastZRTR;
    private static JFormattedTextField fastZRTRField;
    private static Long slowZRTR;
    private static JFormattedTextField slowZRTRField;
    private static Integer xARPRD;
    private static Integer yARPRD;
    private static Integer zARPRD;
    private static Integer xARPRD_Aux;
    private static Integer yARPRD_Aux;
    private static Integer zARPRD_Aux;
    private static JRadioButton xNButton;
    private static JRadioButton xPButton;
    private static JRadioButton yNButton;
    private static JRadioButton yPButton;
    private static JRadioButton zNButton;
    private static JRadioButton zPButton;
    private static JTextField cuttingModeField;
    private static JFormattedTextField fField;
    private static JProgressBar fBar;
    private static JLabel[] aLHLSIcon;
    private static JLabel[] aRHLSIcon;
    private static JFormattedTextField xACPField;
    private static JFormattedTextField yACPField;
    private static JFormattedTextField zACPField;
    private static JFormattedTextField xAMTRField;
    private static JFormattedTextField yAMTRField;
    private static JFormattedTextField zAMTRField;
}

